package com.ttdev.mmms;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 启动项目自动跳转主页
 */
@Component
public class MyCommandRunner implements CommandLineRunner {
    @Value("${server.port}")
    private String port;
    @Override
    public void run(String... args) throws Exception {
        System.out.println(port+"端口启动");
        Runtime.getRuntime().exec("cmd   /c   start   http://localhost:" + port + "/");
    }
}
